package com.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dao.ShoufeiDao;
import com.pojo.Dictionary;
import com.pojo.Shoufei;
import com.util.ValidateHelper;
import com.vo.ShoufeiVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class ShoufeiService extends ServiceImpl<ShoufeiDao, Shoufei> {
    @Autowired
    private ShoufeiDao shoufeiDao;

    /**
     * 分页查询收费记录
     * @param page
     * @param limit
     * @param username 关键字：用户账号、邮箱
     * @param time1 开始时间
     * @param time2 结束时间
     * @return
     */
    public IPage<ShoufeiVo> getRechargeRecord(int page, int limit, String username,String sfr ,String time1, String time2) {
        return shoufeiDao.getRechargeRecord(new Page(page,limit), username,sfr, time1, time2);
    }

    /**
     * 时间收费查询
     * @param timeStart  开始时间
     * @param timeEnd    结束时间
     * @param sfr        收费人ID
     * @param page
     * @param limit
     * @return
     */
    public IPage shoufeiList(String timeStart , String timeEnd , String sfr
            , Integer page , Integer limit){
        return shoufeiDao.shoufeiList(new Page(page , limit), timeStart, timeEnd, sfr) ;
    }
}
